package com.letoken.platform.pub.enums;

import org.apache.commons.lang3.ObjectUtils;

/**
 * 商户视角
 **/
public enum MallAccBusinessTypeEnum {

    DEFAULT_IGNORE("默认",0,0,""),

    TRADE("交易", 1,1,"收入"),
    WITHDRAW("提现", 2,2,"提现"),


    UNKNOWN("unknown", 99,0,"");

    private String name;
    private Integer type;
    private Integer inOut;
    private String alertMsg;

    public Integer getType() {
        return type;
    }

    public String getAlertMsg() {
        return alertMsg;
    }


    MallAccBusinessTypeEnum(String name, Integer type, Integer inOut, String alertMsg) {
        this.name = name;
        this.type = type;
        this.inOut = inOut;
        this.alertMsg = alertMsg;
    }

    public static MallAccBusinessTypeEnum getInstance(Integer state) {
        if (ObjectUtils.isEmpty(state)) return UNKNOWN;
        for (MallAccBusinessTypeEnum sse : values()) {
            if (sse.type.equals(state)) {
                return sse;
            }
        }
        return UNKNOWN;
    }
}
